import java.util.LinkedList;
import java.util.Scanner;

/**
 * @author ShenTuZhiGang
 * @version 1.0.0
 * @email 1600337300@qq.com
 * @date 2021-11-19 19:16
 */
public class Exam2021111901 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int t = scanner.nextInt();
        for (int i = 0; i < t; i++) {
            int n =  scanner.nextInt();
            int k = scanner.nextInt();
            int m = scanner.nextInt();
            int[] a = new int[n];
            int add = 0;
            LinkedList<Integer> q= new LinkedList<>();
            for (int j = 0; j < n; j++) {
                a[j] = scanner.nextInt();
                if ((a[j]+add)%2==1){
                    if(q.isEmpty()){
                        k--;
                        add++;
                        q.push(j+m-1);
                    }else{
                        add--;
                        q.pop();
                    }
                }
                if(q.peek()!=null&&q.peek()==j){
                    q.pop();
                    add--;
                }
            }
            System.out.println(k>=0?"Yes":"No");
        }

    }
}
